// title => 公用
const titleTextStyle = (path) => {
    return [
        {
            label: '标题文本颜色',
            prop: `${path}color`,
            type: 'colorPicker',
            defaultValue: `rgba(0,0,0,1)`
        },
        {
            label: '标题字体风格',
            prop: `${path}fontStyle`,
            type: 'radio',
            optionsList: [
                {
                    label: 'normal',
                    id: 'normal'
                },
                {
                    label: 'italic',
                    id: 'italic'
                },
                {
                    label: 'oblique',
                    id: 'oblique'
                },
            ]
        },
        {
            label: '标题字体粗细',
            prop: `${path}fontStyle`,
            type: 'select',
            optionsList: [
                {
                    label: 'normal',
                    id: 'normal'
                },
                {
                    label: 'bold',
                    id: 'bold'
                },
                {
                    label: 'bolder',
                    id: 'bolder'
                },
                {
                    label: 'lighter',
                    id: 'lighter'
                },
            ]
        },
        {
            label: '标题字体系列',
            prop: `${path}fontFamily`,
            type: 'input',
            defaultValue: 'sans-serif'
        },
        {
            label: '标题字体大小',
            prop: `${path}fontSize`,
            type: 'number',
            controls: true,
            defaultValue: 16,
            precision: '0'
        },
    ]

}
// tooltip => axisPointer
const tooltipAxisPointer = (path) => {
    return [
        {
            label: '坐标轴指示器',
            prop: `${path}type`,
            type: 'select',
            defaultValue: 'line',
            optionsList: [
                {
                    label: 'line',
                    remark: '直线指示器',
                    id: 'line'
                },
                {
                    label: 'shadow',
                    remark: '阴影指示器',
                    id: 'shadow'
                },
                {
                    label: 'none',
                    remark: '无指示器',
                    id: 'none'
                },
                {
                    label: 'cross',
                    remark: '十字准星指示器。其实是种简写，表示启用两个正交的轴的 axisPointer',
                    id: 'cross'
                },
            ]
        },
        {
            label: '指示器的坐标轴',
            type: 'switch',
            prop: `${path}axis`,
            type: 'select',
            optionsList: [
                {
                    label: 'auto',
                    id: 'auto'
                },
                {
                    label: 'x',
                    id: 'x'
                },
                {
                    label: 'y',
                    id: 'y'
                },
                {
                    label: 'radius',
                    id: 'radius'
                },
                {
                    label: 'angle',
                    id: 'angle'
                },
            ],
            defaultValue: 'auto'
        },
        {
            label: '是否自动吸附',
            type: 'switch',
            prop: `${path}snap`,
            defaultValue: true
        },
    ]
}
// tooltip => axisPointer => label
const tooltipAxisPointerLabel = (path) => {
    return [
        {
            label: '是否显示文本',
            type: 'switch',
            prop: `${path}show`,
            defaultValue: false
        },
        {
            label: '小数点精度',
            type: 'input',
            prop: `${path}precision`,
            defaultValue: 'auto',
            tooltip: {
                content: `文本标签中数值的小数点精度。默认根据当前轴的值自动判断。也可以指定如 2 表示保留两位小数。`
            },
        },
        {
            label: 'label距离轴的距离',
            type: 'input',
            prop: `${path}margin`,
            defaultValue: '3'
        },
        {
            label: '文字的颜色',
            type: 'colorPicker',
            prop: `${path}color`,
            defaultValue: '#fff'
        },
        {
            label: '文字字体的风格',
            type: 'select',
            prop: `${path}fontStyle`,
            defaultValue: 'normal',
            optionsList: [
                {
                    label: 'normal',
                    id: 'normal'
                },
                {
                    label: 'italic',
                    id: 'italic'
                },
                {
                    label: 'oblique',
                    id: 'oblique'
                }
            ]
        },
        {
            label: '文字字体的粗细',
            type: 'select',
            prop: `${path}fontWeight`,
            defaultValue: 'normal',
            filterable: true,
            optionsList: [
                {
                    label: 'normal',
                    id: 'normal'
                },
                {
                    label: 'bold',
                    id: 'bold'
                },
                {
                    label: 'bolder',
                    id: 'bolder'
                },
                {
                    label: 'lighter',
                    id: 'lighter'
                },
            ]
        },
        {
            label: '文字的字体系列',
            type: 'select',
            disabled: true,
            prop: `${path}fontFamily`,
            defaultValue: 'sans-serif',
            filterable: true,
            optionsList: [
                {
                    label: 'normal',
                    id: 'normal'
                }
            ]
        },
        {
            label: '文字的字体大小',
            type: 'number',
            prop: `${path}fontSize`,
            defaultValue: 12,
        },
        {
            label: '行高',
            type: 'number',
            prop: `${path}lineHeight`,
        },
        {
            label: '文本显示宽度',
            type: 'number',
            prop: `${path}width`,
        },
        {
            label: '文本显示高度',
            type: 'number',
            prop: `${path}height`,
        },
        {
            label: '文字的描边颜色',
            type: 'colorPicker',
            prop: `${path}textBorderColor`,
        },
        {
            label: '文字的描边宽度',
            type: 'number',
            prop: `${path}textBorderWidth`,
        },
        {
            label: '文字的描边类型',
            type: 'select',
            prop: `${path}textBorderType`,
            defaultValue: 'dashed',
            optionsList: [
                {
                    label: 'solid',
                    id: 'solid'
                },
                {
                    label: 'dashed',
                    id: 'dashed'
                },
                {
                    label: 'dotted',
                    id: 'dotted'
                }
            ]
        },
    ]
}

export { titleTextStyle, tooltipAxisPointer, tooltipAxisPointerLabel }